﻿<!DOCTYPE html>
<html lang="en" >
	<head>
		<meta  charset="utf-8" />
		<title>狼友文化</title>
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<link rel="shortcut icon" type="image/png" href="img/tubiao.png"/>

		<link rel="stylesheet"  href="css/bootstrap.css" type="text/css" />
		<link rel="stylesheet"  href="css/animate.css" type="text/css" />
		<!--<link rel="stylesheet"  href="css/font-awesome.css" type="text/css" />-->
		<link rel="stylesheet" href="css/style.css" type="text/css" />
		<link rel="stylesheet"  href="css/pic-select.css" type="text/css" />
		<link rel="stylesheet"  href="css/xuanfu.css" type="text/css" />

		<link rel="stylesheet" href="css/ngDialog-theme-default.css" type="text/css"/>


		<style>
			.container2 {
				width: 50%;
				margin: 0 auto;
			}
			.waterfall-list {
				/*width: 1024px;*/
				margin: 0;
				padding: 0;
				list-style: none;
				position: relative;
			}
			.waterfall-list li {
				position: absolute;
				left: 0;
				top: 0;
				-webkit-box-sizing: border-box;
				-moz-box-sizing: border-box;
				box-sizing: border-box;
				padding: 5px;
				overflow: hidden;

			}
			.waterfall-list li:after {
				clear: both;
			}
			.waterfall-list li .data-block {
				border: 1px solid #cccccc;
				border-radius: 5px;
				padding: 5px;

			}
			.waterfall-list li p {
				font-size: 12px;
				color: rgba(61, 61, 61, 0.93);
				cursor:pointer;
			}
			.clear {
				clear: both;
			}
			.waterfall-list li img {
				width: 100%;
				height: 100%;
			}
			.loadMore {
				cursor: pointer;
				width: 100%;
				height: 30px;
				line-height: 30px;
				text-align: center;
				border: 1px solid #cccccc;
				border-radius: 5px;
			}
		</style>


		<script  src="js/html5.js"></script>

	</head>
	<body class="index-page"  ng-app = "myApp" ng-controller="myCtrl"  ng-init="loaddata()">



	<div id="page-preloader"><span class="spinner"></span></div>
		<header id="header" class="clear">
			<a href="" onclick="javascript:location.reload() " class="logo">狼友文化</a>
			<div class="header-right">

			</div>
			<nav class="navbar">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
					<span class="sr-only">导航</span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					</button>
				</div>
				<div id="navbar" class="navbar-collapse collapse">
					<ul class="nav navbar-nav menu">
						<li class="dropdown" ng-if="logining"><a href="" ng-click="goPerson()">{{loginuser}}</a></li>
						<li class="dropdown" ng-if="logouting"><a href="" ng-click="login()">登录</a></li>
						<!--<li><a href="" onclick="javascript:location.reload() ">主页</a></li>-->
						<!--<li><a href="" onclick="goImageForm()">发布</a></li>-->
						<li><a href=""  ng-click="chatwe()">聊天室（Beta）</a></li>
						<!--<li><a href=""  onclick="goFooter()">关于</a></li>-->
						<li ng-if ="isapp" ><a href="" onclick="appdownload()">下载狼友文化(安卓版APP)</a></li>
						<li class="dropdown" ng-if="logining"><a href="" ng-click="logout()">退出登录</a></li>
					</ul>
				</div>
			</nav>
		</header>

		<div class="swiper-container" id="slide">
			<div class="swiper-wrapper">
				<div class="swiper-slide" style="background-image:url('img/lan13i.jpg');">
					<div class="caption" data-animation="pulse" data-animation-delay="0s">
						<h1><span>欢迎来到<br/>狼友文化</span></h1>
					</div>
				</div>
				<div class="swiper-slide" style="background-image:url('img/yizhangtupian.jpg');"  onclick="javascript:document.getElementById('contact').scrollIntoView();" >
				</div>
				<div class="swiper-slide" style="background-image:url('img/niming.jpg');"  onclick="javascript:document.getElementById('contact').scrollIntoView();" >
				</div>
				<div ng-if ="isapp" class="swiper-slide" style="background-image:url('img/xiazaitupian.jpg');"  onclick="appdownload()" > >
				</div>
				<!--<div class="swiper-slide" style="background-image:url('img/libai.jpg');"  onclick="javascript:document.getElementById('contact').scrollIntoView();" >-->
				<!--</div>-->
				<!--<div class="swiper-slide" style="background-image:url('img/liuzongyuan.jpg');"  onclick="javascript:document.getElementById('contact').scrollIntoView();" >-->
				<!--</div>-->
				<!--<div class="swiper-slide"  onclick="javascript:document.getElementById('contact').scrollIntoView();" style="background-image:url('img/maibuqifuwuqi.jpg');">-->
					<!--<div class="caption">-->
						<!--<h1><span>嗷呜呜呜呜！</span></h1>-->
						<!--&lt;!&ndash;草原上,谁活着都不容易,谁给谁都得留条活路.&ndash;&gt;-->
					<!--</div>-->
				<!--</div>-->
			</div>

			<a href="#" class="swiper-top-prev"><i class="fa fa-chevron-left" aria-hidden="true"></i></a>
			<a href="#" class="swiper-top-next"><i class="fa fa-chevron-right" aria-hidden="true"></i></a>
		</div>

		<section id="blog">

			<div class="container">
				<h2  ng-click="updateimg()">狼友圈</h2>
				<span ng-if="loading">加载中，请稍后....</span>
				<span ng-if="loaded">加载完成</span>
				<ul class="waterfall-list" ng-waterfall cols="2">
					<li ng-repeat="lyart in lylist" on-finish-render-filters>
						<div  ng-click="readmore(lyart.id,lyart.picPath,lyart.picWord)"  class="data-block">
							<img src="{{lyart.picPath}}" alt="" />
							<!--<img src="{{lyart.picPath}}" alt="" />-->
							<p style="margin-top: 8px;"><span style="color:#23527c;">{{lyart.userName}}</span></p>
							<p style="font-size: 15px;">{{lyart.picWord}}</p>
							<p><span style="color:#23527c;">留言：{{lyart.commCount}}</span></p>
						</div>
					</li>

				</ul>
				<!--ng-if="loadMore" ng-infinite-scroll -->
				<!--<div class="loadMore" ng-click="loadMoreData()">加载更多..</div>-->
				<span ng-if="loading">加载中，请稍后....</span>
				<span ng-if="loaded">加载完成</span>
				<!--<input style="border:0px;background-color:#f8f8f8; width:100%;height:30px;" id="button1" type="button" value="点击召唤更多图文" ng-click="loadOldData()"/>-->
				<div style="border:0px;text-align:center;font-size:20px;color:#aaa; width:100%;height:30px;" id="button1" ng-click="loadOldData()">点击召唤更多图文</div>

			</div>


			<!--<div class="container">-->
				<!--<div  class="row" >-->
				<!--<h2>狼群·事迹</h2>-->
					<!--<article  ng-repeat="lyart in lylist"  class="col-md-4 blog-item  scroll-animation" data-animation="fadeInLeft" data-animation-delay="0s">-->
						<!--<div class="img">-->
							<!--<img src="..{{lyart.picPath}}"/>-->
						<!--</div>-->
						<!--<div class="blog-text">-->
							<!--<a href="" ng-click="readmore(lyart.id,lyart.picPath,lyart.picWord)">-->
								<!--<h5>{{lyart.picWord}}</h5>-->
							<!--</a>-->
							<!--<a href="" ng-click="readmore(lyart.id,lyart.picPath,lyart.picWord)" class="read-more">留言：{{lyart.commCount}}</a>-->
						<!--</div>-->
					<!--</article>-->
				<!--</div>-->
				<!--<input type="button" value="点击加载更多" ng-click="updateimg()"/>-->
			<!--</div>-->
		</section>

		<section id="contact">
			<div style="margin-top: 10px;" class="container scroll-animation" data-animation="fadeInUp" data-animation-delay="0s">
				<div class="contact-form">
					<!--<h2>发发狼友圈</h2>-->
					<div class="row">
						<div class="col-md-6">
							<!--<div class="input-block name-form">-->
								<!--<input type="text" placeholder="Name"/>-->
							<!--</div>-->
							<!--<div class="input-block phone-form">-->
								<!--<input type="text" placeholder="Phone"/>-->
							<!--</div>-->
							<div class="input-block">
								<form  id="imageForm" method="post" enctype="multipart/form-data" action="file/upload">
									<div>
										<div class="_box">选择图片</div>
									</div>
									<div class="none">
										<input type="file" name="file"  accept="image/*"  id="_f" onchange="changepic(this)"/>
									</div>
									<div class="input-block">
										<img id="showimg" src="img/toumingxuanze.png"/>
									</div>
								</form>
							</div>

						</div>
						<form  id="wordForm" method="post" enctype="multipart/form-data" action="file/wordInfo" onsubmit="return false;">
						<div class="col-md-6">

							<div class="input-block message-form">
									<input type="hidden" name="hasName" id="hasName"/>
									<input type="hidden" name="imgAddr" id="imgAddr"/>
									<textarea id="msg" ng-model="msg" ng-change="saveTempData()" name = "msg" placeholder="（文件不要超过10M）图片只能且必须一张，文字不可以超过200个字。"></textarea>

							</div>
						</div>
							<input type="submit" value="发布狼友圈" ng-click="sendToWithName()"/>
						<!--<input type="submit" value="匿名" ng-click="sendTo()"/>-->
						</form>
					</div>
				</div>
			</div>


		</section>



	<footer  ng-if ="isapp"  id="footer">
			<div class="container">
				<div class="row">
					<div class="col-md-4">
						<a href="javascript:location.reload()" class="logo">狼友文化·缺你不可</a>
						<!--<p>在这里，你可以把它当作“朋友圈”，“新闻消息”，“贴吧”，只要你喜欢；这里是狂野，豪迈的狼友聚集地</p>-->
						<!--<p>狼友文化致力于为小伙伴创造有趣的信息交流平台，加入我们成为狼友，你的前方高能。</p>-->
						<!--<p>在本平台发言一律匿名，以保护每个人的隐私。发帖不涉及政治等敏感话题，敏感的帖子将会被删除。</p>-->
						<!--<p>欢迎狼友们提出宝贵意见，我们将竭诚为您服务。意见建议发邮箱：zdwanj@126.com，感谢您的宝贵意见。</p>-->
						<!--<p onclick="goTop()">返回顶部</p>-->
						<!--<li><a href="">网站地图</a></li>-->
						<!--<li><a href="contacts.html">联系我们</a></li>-->
						<!--<li><a href="blog.html">博客</a></li>-->
						<!--<li><a href="https://www.yczihua.com/">画廊</a></li>-->
						<p onclick="appdownload()">下载狼友文化(安卓版APP)</p>

						<div class="copy">Copyright &copy; 2017.粤ICP备17068922号</div>
					</div>
					<div class="col-md-3">

						<img ng-click="goWebVersion()" src="img/0616erweima.png" alt="">
						<!--<h6>最新消息</h6>-->
						<!--<div class="news-footer">-->
							<!--<a href="blog_inner.html">Praesent ullamcorper sodales</a>-->
							<!--<div class="date">14.11.2016</div>-->
						<!--</div>-->
						<!--<div class="news-footer">-->
							<!--<a href="blog_inner.html">Fusce sollicitudin felis vel</a>-->
							<!--<div class="date">14.11.2016</div>-->
						<!--</div>-->
						<!--<div class="news-footer">-->
							<!--<a href="blog_inner.html">Phasellus vitae dictum urna</a>-->
							<!--<div class="date">14.11.2016</div>-->
						<!--</div>-->
					</div>
					<!--<div class="col-md-2">-->
						<!--<h6>平台相关</h6>-->
						<!--<ul class="footer-menu">-->
							<!--<li><a href="" onclick="goTop()">返回顶部</a></li>-->
							<!--&lt;!&ndash;<li><a href="">网站地图</a></li>&ndash;&gt;-->
							<!--&lt;!&ndash;<li><a href="contacts.html">联系我们</a></li>&ndash;&gt;-->
							<!--&lt;!&ndash;<li><a href="blog.html">博客</a></li>&ndash;&gt;-->
							<!--&lt;!&ndash;<li><a href="https://www.yczihua.com/">画廊</a></li>&ndash;&gt;-->
							<!--<li><a href=webAddress+"/ly_app/app-release.apk" >下载狼友文化(安卓版APP)</a></li>-->
						<!--</ul>-->
					<!--</div>-->
					<!--<div  style="margin-top: 10px;"  class="col-md-3">-->
						<!--<a href="http://www.dayu90du.top/apptoweb">狼友文化-网页版</a>-->
						<!--<h6 ng-click="chatwe()">联系我们</h6>-->
						<!--<address>中国广东省广州市</address>-->
						<!--<div class="footer-phone"><i class="fa fa-phone" aria-hidden="true"></i> +1 (138) 566 78 78</div>-->
					<!--</div>-->
				</div>
				<ul class="social">

					<!--<li><a href=""><i class="fa fa-facebook" aria-hidden="true"></i></a></li>-->
					<!--<li><a href=""><i class="fa fa-google-plus" aria-hidden="true"></i></a></li>-->
					<!--<li><a href=""><i class="fa fa-twitter" aria-hidden="true"></i></a></li>-->
					<!--<li><a href=""><i class="fa fa-youtube-play" aria-hidden="true"></i></a></li>-->
				</ul>
			</div>
		</footer>



		<!--右下角悬浮按钮-->

		<!--<div class="contentfd"></div>-->
		<!--<div class="navfd">-->
			<div style="z-index:100;border: 0px solid #ccc;width:30px;height: 30px; position:fixed; bottom: 60px;right: 20px;"><img  onclick="javascript:document.getElementById('contact').scrollIntoView();" width="28px" height="28px"  src="img/bianji.png"/></div>
			<div style="z-index:100;border: 0px solid #ccc;width:30px;height: 30px; position:fixed; bottom: 20px;right: 20px;"><img  onclick="javascript:document.getElementById('header').scrollIntoView();" width="28px" height="35px"  src="img/lyup.png"/></div>
			<!--<span  ng-click="updateimg()"><img width="28px" height="28px" src="img/zhuyetubiao.png"/></span>-->

			<!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
			<!--<span  ng-click="updateimg()">狼群</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
			<!--<span  onclick="javascript:document.getElementById('contact').scrollIntoView();">嗷呜</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
			<!--<span  onclick="javascript:document.getElementById('contact').scrollIntoView();"><img  width="28px" height="28px"  src="img/bianji.png"/></span>-->
			<!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
					<!--<span  ng-click="goPerson()">个人</span>-->
		<!--</div>-->

		<script src="js/lib/jquery-1.10.1.min.js"></script>
		<script src="js/angular/jquery.blockUI.js"></script>
		<script src="js/lib/angular.min.js"></script>
		<script src="js/angular/angular-waterfall.js"></script>
		<script src="js/angular/ngDialog.js"></script>
		<script src="js/lib/ngDialog.min.js"></script>

		<script src="js/lib/jquery.js"></script>
		<script src="js/lib/bootstrap.min.js"></script>
		<script src="js/lib/lightbox.min.js"></script>
		<script src="js/lib/shuffle.js"></script>
		<script src="js/lib/swiper.min.js"></script>
		<script src="js/lib/waypoints.min.js"></script>
		<script src="js/script.js"></script>
		<script src="js/lib/jquery-form.js"></script>

		<script src="js/addressManager.js"></script>

		<script type="text/javascript">

            var app = angular.module("myApp",["ngWaterfall2","ngDialog"]);

            app.controller("myCtrl",function($scope,$http,$timeout, $interval,ngDialog) {

                $scope.loginuser;
                $scope.loginuserId;
                $scope.goWebVersion =function(){

                    window.location.href = webAddress+"/apptoweb";
				}
                $scope.chatwe =function () {
                     if($scope.loginuserId==null){
                         alert("您还未登录，不可进入聊天室！");
                         return;
					 }
                    if ($scope.loginuserId==null){
                        alert("请先登录！");
                        return ;
                    }
					window.open(webAddress + "/contacts.html?chatType=robot&&senderId="+$scope.loginuserId+"&&reciverId=0&&reciverName=robot");
                }
                $scope.goPerson= function() {
                    if ($scope.logining==false){
                        alert("你还未登录！");
                        return false;
                    }else{
                        window.location.href= webAddress + "/about_us.html";
                    }
                }
                $scope.islogin = function () {
                    $http({
                        method:'POST',
                        url:"login/isLogin",
                        data: {}
                    }).success( function (data){
//						console.log(data.info);
                        if (data.status == "s") {
//                            alert(data.info);
							$scope.loginuser = data.info.userName;
                            $scope.loginuserId = data.info.userId;
							$scope.logining = true;
                            $scope.logouting = false;
                        }else{
                            $scope.logining = false;
                            $scope.logouting = true;
						}

                    }).error(function(data, status, headers, config) {});
                }

                $scope.logout = function(){
                    var urlinfo=window.location.href; //获取当前页面的url
//                    var datajson = {"page":"blog","id":urlinfo.substring(urlinfo.lastIndexOf("/")+1)};
                    $http({
                        method:'POST',
                        url:"login/userlogout",
                        data: {}
                    }).success( function (data){
//						console.log(data.info);
                        if (data.status == "s") {
                            window.location.href = data.info + "?service="+urlinfo;
                        }else{
                            alert(data.info);
						}

                    }).error(function(data, status, headers, config) {

                    });
                }
                $scope.login = function(){
//                    window.location.href = "http://localhost:8080/myIndex";
//                    http://localhost:8082/login?service=
                    var urlinfo=window.location.href; //获取当前页面的url
                    var datajson = {"page":"index","id":""};
                    $http({
                        method:'POST',
                        url:"login/recordPageUrl",
                        data: datajson
                    }).success( function (data){
//						console.log(data.info);
                        if (data.status == "s") {
                            window.location.href = data.info;
                        }

                    }).error(function(data, status, headers, config) {

                    });
                }
                $scope.loadMoreData=function(){

//                    alert("loadmore");

				}
                $scope.renderFinish = function(){
                    console.log('渲染完之后的操作')
                }

                $scope.readmore = function(id,picPath,picWord){
					var datajson = {"id":id,"picPath":picPath,"picWord":picWord};
					console.log(datajson);
//                    window.location.href = "http://localhost:8082/cas/login?service=http://localhost:8080/lycomment/readmore/"+id;
//                    window.location.href = "lycomment/readmore/"+id;
					window.location.href = webAddress + "/blog.html?id="+id;
				}
                $scope.loaddata = function() {

                    $scope.isapp = true;
                    if (navigator.userAgent=="app/langyouwenhua_app"){
                        $scope.isapp = false;
					}
                    if (window.localStorage.msg!=null){
                        $scope.msg = window.localStorage.msg;
                    }
//
                    $scope.startLine = 0;
                    $scope.count = 5 ;
                    if (window.localStorage.startLine!=null){
                        $scope.startLine = window.localStorage.startLine;
					}
                    if (parseInt($scope.startLine) >= 5000){
                        $scope.startLine = 10;
                    }
                    $scope.addimg();
                    $scope.islogin();


                }

                $scope.saveTempData = function(){
                    window.localStorage["msg"] = $scope.msg;
                }
                $scope.updateimg = function(){

                    document.getElementById('blog').scrollIntoView();

					window.localStorage.startLine = 0;
					$scope.startLine = window.localStorage.startLine;

                    $scope.addimg();
					//alert("最新数据加载成功！");


				}

                $scope.loadOldData  = function(){



//                    document.getElementById('blog').scrollIntoView();
                    if (parseInt($scope.startLine) >= 5000){
                        alert("没有更多数据咯，快去创作图文吧！");
                        return false;
                    }
                    $scope.startLine = parseInt($scope.startLine) + parseInt($scope.count) ;

                    window.localStorage["startLine"] = $scope.startLine;
                    console.log("$scope.startLine:"+$scope.startLine)

                    $scope.addimg2();
                    //alert("最新数据加载成功！");
                }
                $scope.addimg2 = function(){
                    $("#button1").hide();
                    $scope.loading=true;
                    $scope.loaded = false;
                    //加载
                    //file/selectAll
                    $http({
                        method:'POST',
                        url:"lyarticle/selectArticleMoreInfo_old",
                        data: {"startLine":$scope.startLine,"count":$scope.count,"artId":$scope.lastpicId}
                    }).success( function (data){

                        if(data.status == "s1"){
                            alert(data.info);
						}
                        if (data.status == "s") {
                            var obj = eval ("(" + data.info + ")");
                            console.log("数据加载成功。");
                            console.log(obj);
                            for (var i = 0; i < obj.length; i++) {
                                $scope.lylist.push(obj[i]);
                            }

                            $scope.lastpicId = (obj[4]).id;
//                            alert($scope.lastpicId+"===");

                            $scope.loading=false;
                            $scope.loaded = true;
                            $timeout(function () {
                                $scope.loaded=false;
                                $("#button1").show();
                            },2000);
                        }

                    }).error(function(data, status, headers, config) {

                    });
                }

				$scope.addimg = function(){
                    $("#button1").hide();
                    $scope.loading=true;
                    $scope.loaded = false;
					//加载
					//file/selectAll
					$http({
						method:'POST',
						url:"lyarticle/selectArticleMoreInfo",
						data: {"startLine":$scope.startLine,"count":$scope.count}
					}).success( function (data){

						if (data.status == "s") {
							var obj = eval ("(" + data.info + ")");
                            console.log(obj);
							console.log("数据加载成功。");
							$scope.lylist = obj;
							$scope.lastpicId = (obj[4]).id;
//                            alert($scope.lastpicId+"===");

                            $scope.loading=false;
                            $scope.loaded = true;
                            $timeout(function () {
								$scope.loaded=false;
                                $("#button1").show();
                            },2000);
						}

					}).error(function(data, status, headers, config) {

					});
                }
                $scope.sendToWithName = function () {
                    console.log($("#msg").val());
                    console.log($("#imgAddr").val());
                    if($("#msg").val().length>=200||$("#msg").val().length <= 0){
                        alert("（你的字数是："+$("#msg").val().length+"）字数不要超过200个字！不能为空");
                        return false;
                    }

                    if(isEmojiCharacter($("#msg").val())){
                        alert("不允许表情等等特殊字符！");
                        return;
                    }

                    $("#hasName").val("1");

                    if ($scope.logining==false){
                        $("#hasName").val("0");
                        var con = confirm("由于您未登录，将以匿名方式提交！"); //在页面上弹出对话框
                        if(con==false)return false;
                    }

                    var form = $("#wordForm");
                    var options  = {
                        type:'post',
                        success:function(data){
                            if(data.status=='s'){
                                alert("提交成功！");
                                $("#msg").val("");
                                $("#imgAddr").val("");
                                $("#showimg").attr("src",projectName+"/img/toumingxuanze.png");
                                window.localStorage["msg"] = "";

//                                $scope.updateimg();
                            }else{
//                                alert("提交失败，稍后再试，"+data.info);
                                $scope.delBucket("提交失败，稍后再试，"+data.info);
                            }

                        }
                    };
                    form.ajaxSubmit(options);
                }

                $scope.sendTo =function(){

                    console.log($("#msg").val());
                    console.log($("#imgAddr").val());
                    if($("#msg").val().length>=200){
                        alert("（你的字数是："+$("#msg").val().length+"）字数不要超过200个字！");
                        return false;
                    }
                    $("#hasName").val("0");
                    var form = $("#wordForm");
                    var options  = {
                        type:'post',
                        success:function(data){
                            if(data.status=='s'){
                                alert("提交成功！");
                                $("#msg").val("");
                                $("#imgAddr").val("");
                                $("#showimg").attr("src",projectName+"/img/toumingxuanze.png");
                                window.localStorage["msg"] = "";
//                                $scope.updateimg();
                            }else{
//                                alert("提交失败，稍后再试，"+data.info);
                                $scope.delBucket();
                            }

                        }
                    };
                    form.ajaxSubmit(options);

                }




				//模态对话 框
                $scope.delBucket = function (data) {
                    ngDialog.open({
                        template: '<div class="modal-header">'+
						'<h4 class="modal-title">'+data+'</h4>'+
                        '<div class="modal-footer">'+
						'<button type="submit"  class="btn"  ng-click="confirm()" >确定</button>'+
                        '<button type="button"  class="btn" ng-click="cancel()">取消</button></div></div>',
                        plain:true,
                        className: 'ngdialog-theme-default',
                        width:600,
                        scope: $scope,
                        controller: function ($scope) {

                            $scope.confirm = function () {

                            };
                            $scope.cancel = function () {
//                                alert("sadf");
                                $scope.closeThisDialog();

                            };
                        }
                    });
                };
            });




			jQuery(function () {
                $("._box").click(function () {
                    $("#_f").click();
                });
            });


             function changepic(e){
//                console.log($("#_f")[0].files[0]);
//                 ($("#_f")[0].files[0]);

				//表单提交事件
//                $('#imageForm').submit();
                 subimtBtn();

             }
             var pathName=window.document.location.pathname;
             //获取带"/"的项目名，如：/uimcardprj
             var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
             function subimtBtn() {

                 var form = $("#imageForm");
                 $("#showimg").attr("src","img/tupianjiazaizhong.png");
                 var options  = {
                     type:'post',
                     success:function(data){
                         console.log(data);
                         $("#showimg").attr("src",projectName+data.address);
                         $("#imgAddr").val(data.address);
					 },
					 error:function(data){
                         console.log(data.responseText);
                         alert("图片处理失败，文件太大,支持10M以下");
                         $("#showimg").attr("src","img/toumingxuanze.png");
                         $("#imgAddr").val(null);
					 }
                 };
                 form.ajaxSubmit(options);
//                 $("#imageForm").submit();
             }




			 function goImageForm(){
                 document.getElementById("imageForm").scrollIntoView();
			 }
			 function goFooter(){
			     document.getElementById("footer").scrollIntoView();
			 }
            function goTop() {
                document.getElementById("header").scrollIntoView();
            }

			 //降序查询全部数据，并且动态加载到页面
			 function selectAll(){
                 console.log("test");

                 $.ajax({
                     type: "POST",
				     dataType: "JSON",
//					 data:"name=name1",
                     async: false,
                     url: "file/selectAll",
                     success: function(data) {
                     if (data.status == "s") {
                      var obj = eval ("(" + data.info + ")");
                      console.log(obj.length);
                      var htmlstr = "";
                      for(var i=0; obj.length > i;i++){
//                          alert(obj[i].id);
                          htmlstr = htmlstr + "<article>123</article>";
//						  htmlstr = htmlstr + "<article class='col-md-4 blog-item scroll-animation' data-animation='fadeInLeft' data-animation-delay='0s'>"+
//                             +"<div class='img'><img th:src='@{/}'/></div><div class='blog-text'><a href='blog_inner.html'><h5>picWord</h5></a></div></article>";
					  }

                         $("#waterfall").append(htmlstr);
//						 console.log(data.info);
                     } else {
                         console.log(data.info);
                     }
                 }
             });
			 }

            function appdownload() {

                window.location.href=downloadappurl;

            }
            //判断是否客户端是否为手机，返回false，则为电脑端
            function IsPC() {
                var userAgentInfo = navigator.userAgent;
                var Agents = ["Android", "iPhone",
                    "SymbianOS", "Windows Phone",
                    "iPad", "iPod"];
                var flag = true;
                for (var v = 0; v < Agents.length; v++) {
                    if (userAgentInfo.indexOf(Agents[v]) > 0) {
                        flag = false;
                        break;
                    }
                }
                return flag;
            }


            //判断是否有表情图片
            function isEmojiCharacter(substring) {
                if (substring==null&&substring==""){
                    alert("发送内容不能为空");
                    return true;
                }
                for ( var i = 0; i < substring.length; i++) {
                    var hs = substring.charCodeAt(i);
                    if (0xd800 <= hs && hs <= 0xdbff) {
                        if (substring.length > 1) {
                            var ls = substring.charCodeAt(i + 1);
                            var uc = ((hs - 0xd800) * 0x400) + (ls - 0xdc00) + 0x10000;
                            if (0x1d000 <= uc && uc <= 0x1f77f) {
                                return true;
                            }
                        }
                    } else if (substring.length > 1) {
                        var ls = substring.charCodeAt(i + 1);
                        if (ls == 0x20e3) {
                            return true;
                        }
                    } else {
                        if (0x2100 <= hs && hs <= 0x27ff) {
                            return true;
                        } else if (0x2B05 <= hs && hs <= 0x2b07) {
                            return true;
                        } else if (0x2934 <= hs && hs <= 0x2935) {
                            return true;
                        } else if (0x3297 <= hs && hs <= 0x3299) {
                            return true;
                        } else if (hs == 0xa9 || hs == 0xae || hs == 0x303d || hs == 0x3030
                            || hs == 0x2b55 || hs == 0x2b1c || hs == 0x2b1b
                            || hs == 0x2b50) {
                            return true;
                        }
                    }
                }
            }
		</script>
	</body>
</html>
